Hammer Mapping 101
This is Hammer. But you can call it the Source Engine Constructive Solid Geometry Editor if you really really want to. Contrary to what the above screenshot would have you believe, Hammer is very human-friendly. Not to mention FUN. But first, the fundamentals... 'PRE-LAUNCH CONFIGURATION' If you haven't fired up the Source SDK, do it now. At the base of the SDK window, you'll see two drop-down menus, Engine Version and Current Game. These options will become very relevant once you're ready to map for specific games or mods. But for now, select Half-life 2 '''as your Current Game''' and proceed to launch Hammer. NOTE: '''If at this point Hammer complains about a missing '''gameinfo.txt file, that just means the selected Current Game is installed, but hasn't been run for the first time. Run the game, then come back and launch Hammer. 'POST-LAUNCH CONFIGURATION' Now that Hammer is up and running, first have a look-see through Tools >> Options... ' See all the different configuration files, directory paths, compilers, etc...? Old-school mappers had to fill out and keep track of all that shit all by themselves, whereas today Steam will effectively do all your homework for you. Are we feeling pampered yet? 'INTERFACE Before we get to building maps from scratch, rookie, first you need to get familiar with the interface. From the File >> Open... dialogue box, navigate to this directory: DIRECTORY\SteamApps\STEAM USERNAME\sourcesdk_content\hl2\mapsrc\ ''' and open file '''sdk_d1_trainstation_01.vmf' : Next, to get a better view of the workspace, you'll need to change the Camera/3D Preview '''window to '''3D Textured or 3D Shaded Textured Polygons ' ' Now that the map architecture is recognizable in the 3D preview window, practice moving the camera around with W A S D, Shift, '''and/or the '''Arrow Keys. If you've seen Spectator Mode in a multiplayer FPS, this will be very familiar. If it isn't, play around until it becomes very familiar, because this will be your main method of observing your map as you build it. NOTE: The camera movement keys will only function if the mouse cursor is inside the Camera window. : ----------------------------------------------------------------------------------------- :: ''Before we continue, a few things you need to know: '' : BRUSHES -- Think of them as digital LEGO blocks. Brushes are used for the 'broad strokes' of a map's architectural geometry. Resist the urge to build highly detailed objects using brushes -- that job is better left to prop- and detail-entities. ENTITIES -- This is where the map plugs into the game code. Entities bring functionality to an otherwise static and lifeless map. Lights, props, NPCs, enemies, soundscapes, scripted events, et al -- each of them is an entity with adjustable variables LEAKS -- Something you need to be always mindful of while assembling brush geometry. In order for a map to fully compile, the entire game area (containing the player and every entity on the map) must be FULLY ENCASED by brushes. I'm talking AIR-TIGHT. If there is even a tiny little window to the nothingness outside, the compiler will report a LEAK and refuse to run. Also, if an ENTITY is left outside the game area, this will also result in a leak. NOTE: You may get tempted to get around the leak problem by encasing your entire map with a giant box. This is not a legitimate fix because the compile time and final file size will blow up exponentially. : ----------------------------------------------------------------------------------------- The easiest way to select an object '''is to '''click '''on the object within the Camera window. A selected object will be highlighted RED. You can '''select multiple objects by CTRL+clicking '''on them. '''CTRL+clicking '''on a selected object will '''de-select it You may have noticed that a lot of brushes consist of several pieces -- the map's author has grouped them (CTRL+G) '''for convenience. You can select individual brushes from a group by first enabling '''Ignore Groups (IG) along the top toolbar. With an object selected, press CTRL+E to center the 2D windows on the selected object ''' '''PROTIP: This hotkey doesn't sound like much, but it will soon become your best friend. Believe me, you really DO NOT WANT to be manually aligning the 2D windows every time you make a selection. Use the mouse wheel to adjust the zoom level of 2D windows. When you move a selected object, it will snap to the grid lines (unless you turn snapping off -- very bad idea). You can use the square bracket [ ] '''keys to adjust the grid size for more, or less, precision. With your selected brush all centered, you can drag the handles every which way to resize the brush to your liking. By simply clicking on your selection again in a 2D window, the object with toggle between '''resize / skew / rotate modes You can also clone a selected object by holding down SHIFT while moving the object in one of the 2D windows. 'YOUR VERY FIRST MAP' Yep, time to start from the ground up, so File >> New we go... ENTER '''to '''Create Brush Camera window displays nothing until we create... Clipping Tool (SHIFT+X) ' Repeat to toggle through three modes '''Flip Object horizontal (CTRL+L) ' '''Flip Object vertical (CTRL+I)' VOILA! You now know the most essential part of constructing a Hammer map -- connecting rooms without leaks. ''' Yes, of course, there's a lot more to be done with this gamespace to make it an engaging and dynamic environment, but for the most part, Hammer maps are just elaborate variations on this simple theme. If you can do this, you can do just about anything. To see what your new map looks like in-game, first you must insert a few '''point entities -- namely info_player_start 'and a couple of '''light's. Don't forget to set a value for '''brightness with the light entities. Also, make sure the player spawn entity (info_player_start) isn't sitting flush with the floor, or the player will spawn glued to the ground When you're ready to rock 'n roll, hit F9 'to compile the map and load it in-game. 'TO BE CONTINUED...